package com.common.myspring.service.impl;

import com.common.myspring.annotation.Component;
import com.common.myspring.annotation.Resource;
import com.common.myspring.service.UserService;

/**
 * @title: UserServiceImpl1
 * @Author xu-xiang
 * @Date: 2023/8/26 16:49
 * @description:
 */
@Component
public class UserServiceImpl2 implements UserService {

    @Resource(value = "userServiceImpl1")
    private UserService userService1;

    @Override
    public void say() {
        System.out.println("UserServiceImpl2 调用 userService1 的eat() ");
        userService1.eat();
    }

    @Override
    public void eat() {
        System.out.println("UserServiceImpl2  吃桃子");
    }
}
